#include "UDP_server.hpp"
#include "MassageRoute.hpp"

void Usage(char* argv[])
{
    printf("%s\n\t[Port]", argv[0]);
}
int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        Usage(argv);
        exit(1);
    }

    uint16_t port = std::stoi(argv[1]);    //端口号

    massageRoute route;

    UDPEchoServer server(port, std::bind(&massageRoute::route, &route, \
                         std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));

    server.ServerInit();
    server.ServerStart();

    return 0;
}